package me.luger.core.config;

import me.luger.core.auth.identity.SimpleUserInfoGetter;
import me.luger.core.auth.identity.UserInfoGetter;
import me.luger.core.commom.util.EhCacheUtil;
import org.springframework.cache.CacheManager;
import org.springframework.cache.ehcache.EhCacheCacheManager;
import org.springframework.context.annotation.Bean;

/**
 * Created by luger on 2017/7/1.
 */
public class LugerSimpleConfigurer implements LugerConfigurer {

    @Bean
    public UserInfoGetter userInfoGetter(){
        return new SimpleUserInfoGetter();
    }

    @Bean
    public CacheManager cacheManager() {
        EhCacheUtil.initCacheManagerAndCache("/config/cache/ehcache.xml","short_time_cache");
        return new EhCacheCacheManager(EhCacheUtil.getCacheManager());
    }
}
